package com.ruoyi.qsng.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.qsng.domain.TUserPurchase;
import com.ruoyi.qsng.mapper.TUserPurchaseMapper;
import com.ruoyi.qsng.service.ITUserPurchaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 用户下订单信息Service业务层处理
 * 
 * @author gk
 * @date 2023-07-15
 */
@Service
public class TUserPurchaseServiceImpl implements ITUserPurchaseService
{
    @Autowired
    private TUserPurchaseMapper tUserPurchaseMapper;

    /**
     * 查询用户下订单信息
     * 
     * @param id 用户下订单信息主键
     * @return 用户下订单信息
     */
    @Override
    public TUserPurchase selectTUserPurchaseById(Long id)
    {
        return tUserPurchaseMapper.selectTUserPurchaseById(id);
    }

    /**
     * 查询用户下订单信息列表
     * 
     * @param tUserPurchase 用户下订单信息
     * @return 用户下订单信息
     */
    @Override
    public List<TUserPurchase> selectTUserPurchaseList(TUserPurchase tUserPurchase)
    {
        return tUserPurchaseMapper.selectTUserPurchaseList(tUserPurchase);
    }

    /**
     * 新增用户下订单信息
     * 
     * @param tUserPurchase 用户下订单信息
     * @return 结果
     */
    @Override
    public int insertTUserPurchase(TUserPurchase tUserPurchase)
    {
        tUserPurchase.setCreateTime(DateUtils.getNowDate());
        return tUserPurchaseMapper.insertTUserPurchase(tUserPurchase);
    }

    /**
     * 修改用户下订单信息
     * 
     * @param tUserPurchase 用户下订单信息
     * @return 结果
     */
    @Override
    public int updateTUserPurchase(TUserPurchase tUserPurchase)
    {
        tUserPurchase.setUpdateTime(DateUtils.getNowDate());
        return tUserPurchaseMapper.updateTUserPurchase(tUserPurchase);
    }

    /**
     * 批量删除用户下订单信息
     * 
     * @param ids 需要删除的用户下订单信息主键
     * @return 结果
     */
    @Override
    public int deleteTUserPurchaseByIds(Long[] ids)
    {
        return tUserPurchaseMapper.deleteTUserPurchaseByIds(ids);
    }

    /**
     * 删除用户下订单信息信息
     * 
     * @param id 用户下订单信息主键
     * @return 结果
     */
    @Override
    public int deleteTUserPurchaseById(Long id)
    {
        return tUserPurchaseMapper.deleteTUserPurchaseById(id);
    }
}
